#ifndef _DEVICE_IMAGEPROCESS_H_
#define _DEVICE_IMAGEPROCESS_H_

#include "zf_common_headfile.h"
#include "device_imageElement.h"
#include "device_function.h"
//颜色定义  因为有先例，连颜色都改不来，我直接放这了
#define uesr_RED     0XF800    //红色
#define uesr_GREEN   0X07E0    //绿色
#define uesr_BLUE    0X001F    //蓝色


//宏定义
#define image_h	120//图像高度
#define image_w	160//图像宽度

#define white_pixel	255
#define black_pixel	0

#define bin_jump_num	1//跳过的点数
#define border_max	image_w-2 //边界最大值
#define border_min	1	//边界最小值	
extern uint8 original_image[image_h][image_w];
extern uint8 bin_image[image_h][image_w];//图像数组

extern void image_processfunction(void); //直接在中断或循环里调用此程序就可以循环执行了

extern uint8 image_copy[image_h][image_w]; //原始图片

//边界线
extern uint8 l_border[image_h];//左线数组
extern uint8 r_border[image_h];//右线数组
extern uint8 center_line[image_h];//中线数组
// 在image.h中添加函数声明
void cross_fill(uint8(*image)[image_w], uint8 *l_border, uint8 *r_border, 
                uint16 total_num_l, uint16 total_num_r,
                uint16 *dir_l, uint16 *dir_r, 
                uint16(*points_l)[2], uint16(*points_r)[2]);


/*侧方停车*/

void image_ProcessTask(bool flag);
extern uint8 templ_border[image_h];//存储左线数组
extern uint8 tempr_border[image_h];//存储右线数组

#endif